Skip to main content

vaccineprerequisite

Table Name: vaccineprerequisite

The vaccineprerequisite table defines relationships between vaccines, indicating prerequisites that must be fulfilled before administering a specific vaccine.


Columns

Column NameData TypeConstraintsDescription
vaccineIdsmallint(6)Primary Key, Not Null, Foreign KeyThe ID of the vaccine requiring prerequisites.
vaccinePrerequisiteIdsmallint(6)Primary Key, Not Null, Foreign KeyThe ID of the prerequisite vaccine that must be administered first.
mandatorytinyint(1)NullableIndicates if the prerequisite is mandatory (1) or optional (0).

Indexes

  1. Primary Key:
    • vaccineId, vaccinePrerequisiteId: Ensures uniqueness for each vaccine-prerequisite pair.
  2. Foreign Keys:
    • FKED048EEB160DDAC0:
      • References vaccine(vaccineId) for the vaccineId column.
    • vaccprereq_prereqId_vaccine_vaccineId_FK:
      • References vaccine(vaccineId) for the vaccinePrerequisiteId column.
  3. Additional Index:
    • Index on vaccinePrerequisiteId to improve query performance for prerequisite lookups.

Foreign Key Relations

  1. FKED048EEB160DDAC0:
    • Referenced Table: vaccine
    • Referenced Column: vaccineId
    • Description: Ensures that the vaccineId in the vaccineprerequisite table corresponds to a valid vaccineId in the vaccine table. This establishes the relationship between the vaccine that requires a prerequisite and the prerequisite itself.
  2. vaccprereq_prereqId_vaccine_vaccineId_FK:
    • Referenced Table: vaccine
    • Referenced Column: vaccineId
    • Description: Ensures that the vaccinePrerequisiteId in the vaccineprerequisite table refers to a valid vaccine that acts as a prerequisite. This maintains the integrity of the prerequisite-vaccine relationship.

Usage Notes

  • Purpose:
    • Establishes a dependency relationship between vaccines, ensuring the proper sequence of administration.
    • Helps enforce business rules like "Vaccine B cannot be administered until Vaccine A has been given."
  • Key Attributes:
    • vaccineId: Represents the vaccine that has prerequisites.
    • vaccinePrerequisiteId: Represents the prerequisite vaccine that must be completed first.
    • mandatory: Determines whether the prerequisite is compulsory (1) or optional (0).